package com.aivin.service.impl;

import com.aivin.dao.IPointsDao;
import com.aivin.entity.*;
import com.aivin.service.PointsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * Created by Administrator on 2016/8/22.
 */
@Service
public class PointsServiceImpl implements PointsService{


    @Autowired
   private IPointsDao pointsDao ;

    public  List<PointsTask> queryAllPointsTaskFy( int offset  , int limit ){

        return pointsDao.queryAllPointsTaskFy(offset, limit) ;
    }


    public   List<PointsTask>  queryPointsTaskByUserIdFy(   int userId,  int offset , int limit) {
        return pointsDao.queryPointsTaskByUserIdFy(userId ,offset, limit) ;
    }


    public int  publishTask (@PathVariable PointsTask bean  ){
        int state  = pointsDao.publishTask(bean) ;
        return bean.getTaskId()  ;//  state
    }

    public int  publishReply (@PathVariable TaskReply bean  ){
        int state  = pointsDao.publishReply(bean) ;
        return bean.getReplyId() ;//  state
    }

    public   List<TaskReply>  queryReplyByTaskIdFy( @PathVariable int taskId ,   @PathVariable int offset ,@PathVariable int limit) {
        List<TaskReply> beanList =pointsDao.queryReplyByTaskIdFy(taskId ,offset ,limit)  ;
        return  beanList ;

    }
    public   List<TaskReply>  queryReplyByUserIdFy( @PathVariable int userId ,   @PathVariable int offset ,@PathVariable int limit) {
        List<TaskReply> beanList =pointsDao.queryReplyByUserIdFy(userId ,offset ,limit)  ;
        return  beanList ;

    }



}
